<?php
require_once ('../lib/config.php');
require_once ('../lib/facebook.php');
require_once ('../lib/friends.php');
require_once ('../lib/friend.php');
require_once ('../lib/test.php');
require_once ('../../simpletest/autorun.php');
require_once ('../lib/init.php');

class TestTemplate extends UnitTestCase {
    
    function setUp(){
        global $login_button;
        try{
            $me = getOneself();
        }catch(Exception $e){
            print($login_button);
            exit();
        }
    }
    
    //refer to http://www.simpletest.org/en/unit_test_documentation.html
    function testCallFQL(){ 
    
        $query = "select uid1, uid2 from friend 
				where uid1 IN (
					select uid1 from friend where uid2 = me()
				) and uid2 IN (
					select uid1 from friend where uid2 = me()
				) ";
            

        try{
            $response = callFQL($query);
            
            print_r($response);
    
            $this->assertNotNull($response);
            $this->assertTrue(is_array($response));
        }catch(FacebookApiException $e){
            $this->assertTrue(false);
        }        
 
    }
}
?>
